package com.design.classroommanagement.util;

import java.sql.PreparedStatement;
import java.sql.Connection;
import java.sql.ResultSet;
public class UserTeacher {
    public Boolean select( String id, String password) throws Exception {
        PreparedStatement prepare = null;
        teacher item=null;
        Connection conn=DBUtils.getConnect();
        String sql = "select * from teacher where Tno=?and Password=?";
        try {
            prepare = conn.prepareStatement(sql);
            prepare.setString(1, id);
            prepare.setString(2, password);
            ResultSet rs = prepare.executeQuery();
            if (rs.next()) {
                item = new teacher();
                item.setTno(id);
                item.setPassword(password);
                return true;
            }

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
        }
        return false;
    }
}
